{% extends "admin/common_base.html" %}

{% block main %}


<div class="main">
    <div class="body container">
        <div class="typecho-page-title">
            <h2>阅读设置</h2>
        </div>
        <div class="row typecho-page-main" role="form">
            <div class="col-mb-12 col-tb-8 col-tb-offset-2">
                <form action="http://www.typecho.cn/index.php/action/options-reading?_=272f743920ae7d71e903dc5355914687" method="post" enctype="application/x-www-form-urlencoded">
                    <ul class="typecho-option" id="typecho-option-item-frontPage-1">
                        <li>
                            <label class="typecho-label">
                                站点首页</label>
                            <span class="multiline">
                                <input name="frontPage" type="radio" value="recent" id="frontPage-recent" checked="true">
                                <label for="frontPage-recent">
                                    显示最新发布的文章</label>
                            </span>
                            <span class="multiline">
                                <input name="frontPage" type="radio" value="page" id="frontPage-page">
                                <label for="frontPage-page">
                                    使用 </label>
                                <select name="frontPagePage" id="frontPage-frontPagePage">
                                    <option value="2">关于</option>
                                    <option value="5">下载</option>
                                </select>
                                <label for="frontPage-frontPagePage"> 页面作为首页</label>
                            </span>
                            <span class="multiline front-archive hidden">
                                <input type="checkbox" id="frontArchive" name="frontArchive" value="1">
                                <label for="frontArchive">同时将文章列表页路径更改为
                                    <input type="text" name="archivePattern" class="w-20 mono" value="/blog/">
                                </label>
                            </span>
                        </li>
                    </ul>
                    <ul class="typecho-option" id="typecho-option-item-postsListSize-2">
                        <li>
                            <label class="typecho-label" for="postsListSize-0-3">
                                文章列表数目</label>
                            <input id="postsListSize-0-3" name="postsListSize" type="text" class="w-20" value="10">
                            <p class="description">
                                此数目用于指定显示在侧边栏中的文章列表数目.</p>
                        </li>
                    </ul>
                    <ul class="typecho-option" id="typecho-option-item-pageSize-3">
                        <li>
                            <label class="typecho-label" for="pageSize-0-4">
                                每页文章数目</label>
                            <input id="pageSize-0-4" name="pageSize" type="text" class="w-20" value="5">
                            <p class="description">
                                此数目用于指定文章归档输出时每页显示的文章数目.</p>
                        </li>
                    </ul>
                    <ul class="typecho-option" id="typecho-option-item-sidebarBlock-1">
                        <li>
                            <label class="typecho-label">
                                侧边栏显示</label>
                            <span class="multiline">
                                <input name="sidebarBlock[]" type="checkbox" value="ShowRecentPosts" id="sidebarBlock-ShowRecentPosts" checked="true">
                                <label for="sidebarBlock-ShowRecentPosts">
                                显示最新文章</label>
                            </span>
                            <span class="multiline">
                                <input name="sidebarBlock[]" type="checkbox" value="ShowCategory" id="sidebarBlock-ShowCategory" checked="true">
                                <label for="sidebarBlock-ShowCategory">
                                显示分类</label>
                            </span>
                            <span class="multiline">
                                <input name="sidebarBlock[]" type="checkbox" value="ShowArchive" id="sidebarBlock-ShowArchive" checked="true">
                                <label for="sidebarBlock-ShowArchive">
                                显示归档</label>
                            </span>
                            <span class="multiline">
                                <input name="sidebarBlock[]" type="checkbox" value="ShowOther" id="sidebarBlock-ShowOther" checked="true">
                                <label for="sidebarBlock-ShowOther">
                                显示其它杂项</label>
                            </span>
                        </li>
                    </ul>
                    <ul class="typecho-option typecho-option-submit" id="typecho-option-item-submit-5">
                        <li>
                            <button type="submit" class="btn primary">
                                保存设置</button>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>
</div>

{% endblock %}
{% block footer %}
<script>
        (function () {
            $(document).ready(function () {
                var error = $('.typecho-option .error:first');

                if (error.length > 0) {
                    $('html,body').scrollTop(error.parents('.typecho-option').offset().top);
                }

                $('form').submit(function () {
                    if (this.submitted) {
                        return false;
                    } else {
                        this.submitted = true;
                    }
                });

                $('label input[type=text]').click(function (e) {
                    var check = $('#' + $(this).parents('label').attr('for'));
                    check.prop('checked', true);
                    return false;
                });
            });
        })();
        </script>
        <script>
                $('#frontPage-recent,#frontPage-page,#frontPage-file').change(function () {
                    var t = $(this);
                    if (t.prop('checked')) {
                        if ('frontPage-recent' == t.attr('id')) {
                            $('.front-archive').addClass('hidden');
                        } else {
                            $('.front-archive').insertAfter(t.parent()).removeClass('hidden');
                        }
                    }
                });
                </script>
{% endblock %}